package com.entity.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;


/**
 * 订单详情表 表定义层。
 *
 * @author admin
 * @since 2024-05-30
 */
public class FOrderdetailTableDef extends TableDef {

    private static final long serialVersionUID = 1L;

    /**
     * 订单详情表
     */
    public static final FOrderdetailTableDef F_ORDERDETAIL = new FOrderdetailTableDef();

    /**
     * 索引
     */
    public final QueryColumn ID = new QueryColumn(this, "id");

    /**
     * 商品数量
     */
    public final QueryColumn NUM = new QueryColumn(this, "num");

    
    public final QueryColumn UNIT = new QueryColumn(this, "unit");

    /**
     * 商品介绍
     */
    public final QueryColumn INTRO = new QueryColumn(this, "intro");

    /**
     * 商品价格
     */
    public final QueryColumn PRICE = new QueryColumn(this, "price");

    /**
     * 商品图片
     */
    public final QueryColumn IMG_URL = new QueryColumn(this, "img_url");

    /**
     * 订单id
     */
    public final QueryColumn ORDER_ID = new QueryColumn(this, "order_id");

    /**
     * 商品名称
     */
    public final QueryColumn GOOD_NAME = new QueryColumn(this, "good_name");

    /**
     * 商品总价
     */
    public final QueryColumn TOTAL_PRICE = new QueryColumn(this, "total_price");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, GOOD_NAME, PRICE, NUM, IMG_URL, TOTAL_PRICE, ORDER_ID, UNIT, INTRO};

    public FOrderdetailTableDef() {
        super("", "f_orderdetail");
    }

    private FOrderdetailTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public FOrderdetailTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new FOrderdetailTableDef("", "f_orderdetail", alias));
    }

}
